<? include_once("../../../common/common_setting_unit.php"); //引入通用的设置文件?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <? include_once(ROOT_PATH_ . "/controller/common/module/head.php"); ?>
    <? include_once("../controller/data_list.php"); ?>
</head>

<body>
<div id="topbar">
    <?php include ROOT_PATH_ . '/controller/common/module/topbar.php'; ?>
</div>

<div id="container" class="<? echo $now_extender ?>">
<div id="maincontent">


        <div id="sidebar">
            <?php include ROOT_PATH_ . '/controller/common/module/sidebar.php'; ?>
        </div>



        <div id="content">

            <!--标题设定-->
            <?php $page_title='数据列表';?>
            <?php include ROOT_PATH_ . '/controller/common/module/mod-page-title.php'; ?>

            <!--搜索框-->
            <?php include 'module/mod-search.php'; ?>


            <!--功能按钮：新增，统计，全选，排序，导出之类的-->
            <?php include 'module/mod-function.php'; ?>



<?
//==============================================================================
//这里开始才是平常开发需要注重的部分，其余的基本不用理会
//==============================================================================
?>


            <!-- 用$now_extender .list_boxe来控制来到确认板块信息显示-->
            <div class="list-box">
                    <table class="layui-table">
                        <colgroup>
                            <col >
                        </colgroup>
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>姓名</th>
                            <th>工号</th>
                            <th>工龄</th>
                            <th>职位</th>
                            <th>电话</th>
                            <th>状态</th>
                            <th>登陆权限</th>
                            <th>时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>


                        <?php for ($i = 0; $i < $_quantity_per_page; $i++) {?>

                            <tr id="item<? echo $data['data_list'][$i]['nid'] ?>">

                                <td><? echo $i + 1 + $plate['page_list_num'] * ($nowpageid - 1) ?></td>

                                <td> <? echo $data['data_list'][$i]['name'] ?></td>

                                <td><? echo $data['data_list'][$i]['mid'] ?></td>

                                <?
                                //判断离职日期。如果没有离职日期，就取当前日期。
                                if ($data['data_list'][$i]['leavedate'] == "0000-00-00 00:00:00") {
                                    $data['data_list'][$i]['leavedate'] = date("Y-m-d");
                                }
                                $age = count_period($data['data_list'][$i]['applydate'], $data['data_list'][$i]['leavedate']);
                                ?>
                                <td><? echo $age[0] . "年" . $age[1] . "月" . $age[2] . "天"; ?></td>
                                <td><? echo $data['data_list'][$i]['position'] ?></td>
                                <td><? echo $data['data_list'][$i]['phone'] ?></td>
                                <td><? echo $data['data_list'][$i]['status'] ?></td>
                                <td><?
                                        if ($data['data_list'][$i]['authority'] == "是") {echo "是";}
                                        else { echo "否";}
                                     ?>
                                </td>
                                <td><? echo $data['data_list'][$i]['date'] ?></td>
                                <td>


                                    <a href="data_edit.php?<? echo $data['url_parameter'] ?>&nid=<? echo $data['data_list'][$i]['nid'] ?>"
                                       class="layui-btn  layui-btn-sm">
                                       <i class="fa fa-bar-chart-o" aria-hidden="true"></i>修改
                                    </a>

                                    <a href="data_edit.php?now_extender=employee&nid=<? echo $data['data_list'][$i]['nid'] ?>&nowpageid=<? echo $_REQUEST['nowpageid'] ?>"
                                       class="layui-btn  layui-btn-sm" target="_blank">
                                        <i class="fa fa-bar-chart-o" aria-hidden="true"></i>信息
                                    </a>

                                    <span
                                            onclick="deleter(<?php echo $data['data_list'][$i]['nid'] ?>,'data_delete')"
                                            class="layui-btn layui-btn-sm layui-btn-primary">
                                        <i class="layui-icon">&#xe640;</i>删除
                                    </span>
                                </td>

                                
                            </tr>
                        <?php;} ?>



                        </tbody>
                    </table>


<?
//==============================================================================
//这里上面才是平常开发需要注重的部分，下面的基本不用理会，只有底部JS部分需要根据实际情况去加载
//==============================================================================
?>


                    <?php //无数据时显示
                    if (count($data['data_list']) == 0) { echo "暂无数据"; }
                    ?>



                    <!-- todo 这里需要做0判断-->
                    <?php include 'module/page_numbers.php'; ?>


            </div>
            <!--list-box end-->


        </div>
        <!--content端點01-->



</div>
<!--maincontent-->
<br class="clearfloat"/>
</div>
<!--container-->
</div>







<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>


</body>
</html>
